<template>
  <div class="creat_en_vue_content">
    <Header name="搭建Vue环境" />
    <span class="header3">
      1.安装nodejs
    </span>
    <div class="common_body creat_en_vue_page">
      <span>下载地址http://nodejs.cn/download/</span>
      <span> 安装node.js的同时，会自动安装npm，安装目录分别为</span>
      <span class="common_body"> Node.js /usr/local/bin/node</span>
      <span class="common_body">
        npm /usr/local/bin/npm
      </span>
      <span>
        安装完成后，再终端输入命令node -v和npm -v
      </span>
    </div>
    <span class="header3">
      2.cnpm安装
    </span>
    <div class="common_body creat_en_vue_page">
      <span>很多npm包下载很慢，为了提高npm包下载速度，需要安装cnpm/</span>
      <span>首先处理读写权限</span>
      <span class="common_body">
        sudo chmod -R 777 /usr/local/lib/node_modules/
      </span>
      <span>接下来输入</span>
      <span class="common_body">
        sudo npm install -g cnpm --registry=https://registry.npm.taobao.org
      </span>
      <span>
        安装完成后，终端输入cnpm -v，验证是否安装成功
      </span>
    </div>
    <span class="header3">
      3.安装vue-cli脚手架
    </span>
    <span class="common_body">
      sudo cnpm install -g @vue/cli
    </span>
    <span class="header3">
      4.初始化项目
    </span>
    <span class="common_body">
      vue create vue-project
    </span>
    <span class="header3">
      5.运行项目
    </span>
    <div class="common_body creat_en_vue_page">
      <span> 在vue-project目录中运行命令安装依赖</span>
      <span>cnpm install</span>
      <span>
        运行
      </span>
      <span>cnpm run serve</span>
    </div>
  </div>
</template>

<script>
export default {
  name: "CreatVueEnvironment",
  mounted() {}
};
</script>

<style scoped lang="stylus">
@import "components/common_md_class.styl"

.creat_en_vue_content
  display flex;
  width 100%;
  height 100%;
  padding-left 32px;
  flex-direction column;

.creat_en_vue_page
  display flex;
  flex-direction column;
  span
    padding-top 4px;
</style>
